#nullable enable

using System.Text.Json.Serialization;

namespace PHMEE.DTOS.StatusMonitor;

public class CurrentWeatherDto
{
    /// <summary>
    /// 温度（2m）摄氏度
    /// </summary>
    public double Temperature2m { get; set; }
        
    /// <summary>
    /// 相对湿度（2m）%
    /// </summary>
    public int RelativeHumidity2m { get; set; }
        
    /// <summary>
    /// 天气代码
    /// </summary>
    public int WeatherCode { get; set; }
    
    /// <summary>
    /// 海平面气压（hPa）
    /// </summary>
    public double PressureMsl { get; set; }
        
    /// <summary>
    /// 风速（10m）km/h
    /// </summary>
    public double WindSpeed10m { get; set; }
        
    /// <summary>
    /// 风向（10m）°
    /// </summary>
    public double WindDirection10m { get; set; }
    
    /// <summary>
    /// 阵风（10m）km/h
    /// </summary>
    public double WindGusts10m { get; set; }
}

public class OpenMeteoCurrentWeatherResponse
{
    [JsonPropertyName("current")]
    public OpenMeteoCurrentWeatherResponseCurrent Current { get; set; } = null!;
}

public class OpenMeteoCurrentWeatherResponseCurrent
{
    [JsonPropertyName("temperature_2m")]
    public double Temperature2m { get; set; }
    
    [JsonPropertyName("relative_humidity_2m")]
    public int RelativeHumidity2m { get; set; }
    
    [JsonPropertyName("weather_code")]
    public int WeatherCode { get; set; }
    
    [JsonPropertyName("pressure_msl")]
    public double PressureMsl { get; set; }
    
    [JsonPropertyName("wind_speed_10m")]
    public double WindSpeed10m { get; set; }
    
    [JsonPropertyName("wind_direction_10m")]
    public double WindDirection10m { get; set; }
    
    [JsonPropertyName("wind_gusts_10m")]
    public double WindGusts10m { get; set; }
}
